import request from '@/utils/request';

/**
 * 修改用户昵称和头像
 * @param {String} emcee_name //
 * @param {String} avator
 */
export const editNameAndHeadImg = ({ emcee_name, avator }) => {
  return request.post('/host/personalInformation', {
    emcee_name,
    avator,
  });
};

/**
 * 获取绑定微信的二维码
 * @param {String} user_name //
 * @param {String} headimg_url
 */
export const getBindWXERCode = ({ request_from_page } = { request_from_page: 'api/app/user' }) => {
  return request.post('/host/bangDingVxQrCode', {
    request_from_page,
  });
};

/**
 * 是否  已绑定微信号
 */
export const judgeIsBindWX = ({ request_from_page } = { request_from_page: 'api/app/user' }) => {
  return request.post('/host/isBangDingWx', {
    request_from_page,
  });
};

/**
 * 解绑微信号
 */
export const unBIndWX = ({ request_from_page } = { request_from_page: 'api/app/user' }) => {
  return request.post('/host/notBangDingWx', {
    request_from_page,
  });
};

/**
 * 设置  微信推送
 */
export const setWeChatPushNotice = ({ request_from_page = 'api/app/user', notice_type, notice_value }) => {
  return request.post('/noticeUser/editNotice', {
    request_from_page,
    [notice_type]: notice_value,
  });
};

/**
 * 获取用户推送设置
 */

export const getWeChatSettingList = ({ request_from_page = 'api/app/user' }) => {
  return request.post('/noticeUser/noticeInfo', {
    request_from_page,
  });
};

/**
 * 获取  吸粉 列表
 */
export const getFansList = ({ request_from_page = 'api/app/user' }) => {
  return request.post('/gzh/getShouQuanList', {
    request_from_page,
  });
};

/**
 * 获取  吸粉 绑定公众号二维码
 */
export const getFansERCode = ({ request_from_page = 'api/app/user', id }) => {
  return request
    .post('/gzh/shouQuan2', {
      request_from_page,
      id,
    });
};

/**
 * 设置吸粉开关
 */

export const getFansSwitch = ({ request_from_page = 'api/app/user', auth_appid }) => {
  return request.get('/gzh/switchPowder', { params: { auth_appid, request_from_page } });
};

/**
 * 帮我吸粉
 */

export const helpMeGetFans = ({ request_from_page = 'api/app/user', invitee_id }) => {
  request.get('/yaoQing/helpMePowder', {
    invitee_id,
    request_from_page,
  });
};

/**
 * 取消帮我吸粉
 */

export const cancelHelpMeGetFans = ({ request_from_page = 'api/app/user', invitee_id }) => {
  request.get('/yaoQing/cancelPowder', {
    invitee_id,
    request_from_page,
  });
};
